<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<jsp:directive.page language="java"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" />
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>咨询单列表</title>
		<%@ include file="/commons/includes/head.jspf"%>
		<%@ include file="/commons/extremecomponents/extremetable.jspf"%>
		<%@ include file="/commons/manage/content.jspf"%>
		<script type="text/javascript" src="<c:url value="/commons/scripts/calendar.js" />"></script>
		<script type="text/javascript" src="<c:url value="/commons/scripts/userSelector.js" />"></script>
		<script type="text/javascript" src="consultationList.js"></script>
	</head>
	<body>
		<form name="consultationList" action="consultationList.shtml"
			method="post">
			<input type="hidden" id="event" name="event" />
			<input type="hidden" name="ec_f_state" value="${param.ec_f_state}" />
			<input type="hidden" name="ec_f_exstate" value="${param.ec_f_exstate}" />
			<input type="hidden" name="queryNow" value="${param.queryNow}" />
			<input type="hidden" name="expert"  />
			<div class="contBtnDiv">
				<div class="comments"><li>${stateMap[param.ec_f_state]}咨询单</div>
				<c:if test="${param.ec_f_state eq 'TOASSIGNED'}">
					<span class="contBtn contBtnNew" id="btnAssign">分 配</span>
				</c:if>
				<span class="contBtn contBtnSearch" id="btnQuery">查 询</span>
			</div>
			<div class="showSearchDiv">
				<div class="downBtn"></div>
			</div>
			<div class="searchDiv">
				<table style="width: 100%;">
					<tr>
						<td align="center" width="15%">
							所属领域：
						</td>
						<td style="width: 35%;">
							<select id="selCat" style="width: 129px;">
								<option></option>
								<c:forEach var="cat" items="${catalogMap}">
									<option value="${cat.value.id}">
										${cat.value.title}
									</option>
								</c:forEach>
							</select>
							<select id="selSubCat" style="width: 128px;">
								<option></option>
							</select>
							<select name="ec_f_catalog" style="display: none;">
								<option></option>
								<c:forEach var="cat" items="${allCatalog}">
									<option value="${cat.value.id}"
										superior="${cat.value.superior}"
										<c:if test="${cat.value.id eq param.ec_f_catalog}">selected="selected"</c:if>
										<c:if test="${cat.value.level eq 2}">id="opSubCat${cat.value.superior}"</c:if>>
										${cat.value.title}
									</option>
								</c:forEach>
							</select>
						</td>
						<td align="center" width="15%">
							咨询主题：
						</td>
						<td style="width: 35%;">
							<input type="text" class="text" name="ec_f_title" value="${param.ec_f_title}"
								style="width: 250px;" />
						</td>
					</tr>
					<tr>
						<td align="center">
							提交时间：
						</td>
						<td>
							<input type="text" class="text" name="ec_f_submitTimeBegin"
								value="${param.ec_f_submitTimeBegin}" onfocus="calendar();"
								style="width: 115px;" readonly="readonly" />
							至
							<input type="text" class="text" name="ec_f_submitTimeEnd"
								value="${param.ec_f_submitTimeEnd}" onfocus="calendar();"
								style="width: 115px;" readonly="readonly" />
						</td>
						<td align="center">
							咨询企业：
						</td>
						<td>
							<input type="text" class="text" name="ec_f_enterprise" value="${param.ec_f_enterprise}"
								style="width: 250px;" />
						</td>
					</tr>
					<tr>
						<td align="center">
							咨询内容：
						</td>
						<td colspan="3">
							<input type="text" class="text" name="ec_f_question" value="${param.ec_f_question}"
								style="width: 657px;" />
						</td>
					</tr>
				</table>
			</div>
			<ec:table items="consultationList" var="consultation"
				theme="eXtManage" view="manage" form="consultationList"
				action="consultationList.shtml">
				<ec:row>
					<c:url var="editUrl"
						value="consultationEdit.shtml?id=${consultation.id}" />
					<ec:column property="id" sortable="false"
						headerStyle="text-align: center;"
						style="text-align: center; width: 50px;"
						title="<input type='checkbox' title='全选' onclick='javascript: selectAll(\"selectedIds\");' />">
						<input type="checkbox" name="selectedIds"
							value="${consultation.id}" />
					</ec:column>
					<ec:column property="catalog" title="所属领域" alias="CATALOG_"
						style="width: 150px;">
						<a href="${editUrl}"><c:out
								value="${allCatalog[consultation.catalog].fullTitle}" /> </a>
					</ec:column>
					<ec:column property="title" title="咨询主题" alias="TITLE_"
						style="width: 150px;">
						<div class="showShort" style="width: 150px;"
							title="${consultation.title}">
							<a href="${editUrl}"><c:out value="${consultation.title}" />
							</a>
						</div>
					</ec:column>
					<ec:column property="enterprise" title="咨询企业" alias="ENTP_"
						style="width: 80px;">
						<a href="${editUrl}"><c:out value="${userMap[consultation.enterprise].name}" />
						</a>
					</ec:column>
					<ec:column property="submitTime" title="提交时间" alias="SUBMIT_TIME_"
						style="width: 110px;">
						<a href="${editUrl}"><fmt:formatDate
								value="${consultation.submitTime}" pattern="yyyy-MM-dd HH:mm" />
						</a>
					</ec:column>
					<c:if test="${param.ec_f_state eq 'TOASSIGNED'}">
						<ec:column property="question" title="咨询内容" alias="QUSTN_">
							<div class="showShort" style="width: 230px;"
								title="${consultation.question}">
								<a href="${editUrl}"><c:out value="${consultation.question}" />
								</a>
							</div>
						</ec:column>
					</c:if>
					<c:if test="${param.ec_f_state ne 'TOASSIGNED'}">
						<c:if test="${param.ec_f_state eq 'ASSIGNED'}">
							<ec:column property="customService" title="派单客服" alias="CUST_SERV_"
								style="width: 100px;">
								<a href="${editUrl}"><c:out value="${userMap[consultation.customService].name}" />
								</a>
							</ec:column>
							<ec:column property="receiveTime" title="派发时间" alias="RECV_TIME_"
								style="width: 140px;">
								<a href="${editUrl}"><fmt:formatDate
										value="${consultation.receiveTime}" pattern="yyyy-MM-dd HH:mm" />
								</a>
							</ec:column>
						</c:if>
						<ec:column property="expert" title="专家 " alias="EXPERT_"
							style="width: 80px;">
							<a href="${editUrl}"><c:out value="${userMap[consultation.expert].name}" />
							</a>
						</ec:column>
					</c:if>
					<c:if test="${param.ec_f_state eq 'REPLIED'}">
						<ec:column property="reply" title="专家答复 " alias="REPLY_"
							style="width: 100px;">
							<a href="${editUrl}"><c:out value="${consultation.reply}" />
							</a>
						</ec:column>
						<ec:column property="replyTime" title="回复时间" alias="RE_TIME_"
							style="width: 140px;">
							<a href="${editUrl}"><fmt:formatDate
									value="${consultation.replyTime}" pattern="yyyy-MM-dd HH:mm" />
							</a>
						</ec:column>
					</c:if>
				</ec:row>
			</ec:table>
		</form>
	</body>
</html>